package com.gtq.uhome.util;

import java.util.HashMap;
import java.util.Map;

/**
 * @description:
 * @author: Zhong Ranjie
 * @create: 2020-08-07 16:20
 **/
public class UtilsForString {

    public static Map<String, String> splitString(String string) {
        Map<String, String> map = new HashMap<>();
        String s = string.replaceAll("[\\[\\]]", "");
        String[] temp = s.split(",");
        for (String value : temp) {
            int length = value.substring(value.indexOf("-")).length();
            map.put(value, value.substring(0, value.length() - length));
        }
        return map;
    }

}
